"""
操作日志类
"""
from selenium.webdriver.common.by import By
from pages.base_page import BasePage


class OpLogPage(BasePage):

    all_btn_locator = (By.CSS_SELECTOR, "body > div.container > div.row > div.span2.knowledgecate > ul > li:nth-child(2) > a")
    add_btn_locator = (By.LINK_TEXT, "添加")
    business_btn_locator = (By.CSS_SELECTOR, "body > div.container > div.row > div.span2.knowledgecate > ul > li:nth-child(3) > a")
    clue_btn_locator = (By.CSS_SELECTOR, "body > div.container > div.row > div.span2.knowledgecate > ul > li:nth-child(6) > a")
    customer_btn_locator = (By.CSS_SELECTOR, "body > div.container > div.row > div.span2.knowledgecate > ul > li:nth-child(5) > a")
    del_btn_locator = (By.LINK_TEXT, "删除")
    edit_btn_locator = (By.LINK_TEXT, "编辑")
    finance_btn_locator = (By.CSS_SELECTOR, "body > div.container > div.row > div.span2.knowledgecate > ul > li:nth-child(7) > a")
    product_btn_locator = (By.CSS_SELECTOR, "body > div.container > div.row > div.span2.knowledgecate > ul > li:nth-child(4) > a")
    recycle_btn_locator = (By.LINK_TEXT, "回收站")
    click_opearte_log_locator=(By.CSS_SELECTOR,'body > div.container > div.row > div.span2.knowledgecate > ul > li:nth-child(2) > a')
    click_add_locator=(By.CSS_SELECTOR,'body > div.container > div.row > div:nth-child(2) > p > a:nth-child(3)')
    click_commercial_locator=(By.CSS_SELECTOR,'body > div.container > div.row > div.span2.knowledgecate > ul > li:nth-child(3) > a')
    def click_all(self):
        """点击全部"""
        self.driver.find_element(*self.all_btn_locator).click()

    def click_business(self):
        """点击商机"""
        self.driver.find_element(*self.business_btn_locator).click()

    def click_clue(self):
        """点击线索"""
        self.driver.find_element(*self.clue_btn_locator).click()

    def click_customer(self):
        """点击客户"""
        self.driver.find_element(*self.customer_btn_locator).click()

    def click_del(self):
        """点击删除"""
        self.driver.find_element(*self.del_btn_locator).click()

    def click_finance(self):
        """点击财务"""
        self.driver.find_element(*self.finance_btn_locator).click()

    def click_product(self):
        """点击产品"""
        self.driver.find_element(*self.product_btn_locator).click()

    def click_recycle(self):
        """点击回收站"""
        self.driver.find_element(*self.recycle_btn_locator).click()

    def click_add_btn(self):
        """点击保存"""
        self.driver.find_element(*self.all_btn_locator).click()

    def click_edit(self):
        """点击编辑"""
        self.driver.find_element(*self.edit_btn_locator).click()
    def click_add(self):
        """点击添加"""
        self.driver.find_element(*self.click_add_locator).click()
    def click_commercial(self):
        """点击商机"""
        self.driver.find_element(*self.click_commercial_locator).click()








